package com.hangzhou.welbeing.welbeinginstrument.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.hangzhou.welbeing.welbeinginstrument.R;
import com.hangzhou.welbeing.welbeinginstrument.adapter.PayAttentionToAdapter;
import com.hangzhou.welbeing.welbeinginstrument.inteface.OnRecyclerViewItemClickListener;
import com.hangzhou.welbeing.welbeinginstrument.utils.Utils;
import com.jcodecraeer.xrecyclerview.ProgressStyle;
import com.jcodecraeer.xrecyclerview.XRecyclerView;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;


/**
 * 时间 2017 年 08 月 28.
 * 作者 Administrator  刘传华
 * 公司 杭州惟君医疗科技有限公司
 * 包名 com.hangzhou.welbeing.pregnant.welbeing_pregnant.activity
 * 工程名 welbeing_pregnant
 *
 * @desc 关注的视频
 */
public class FocusVideoActivity extends Activity {
    @Bind(R.id.activity_focus_video_iv_return)
    ImageView activityFocusVideoIvReturn;
    @Bind(R.id.activity_focus_video_tv_titile)
    TextView activityFocusVideoTvTitile;
    @Bind(R.id.activity_focus_video_tv_Pay_attention)
    TextView activityFocusVideoTvPayAttention;
    @Bind(R.id.activity_focus_video_XRecyclerView)
    XRecyclerView activityFocusVideoXRecyclerView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_focus_video);
        ButterKnife.bind(this);


        Utils.setStatusBar(this,false,false);
        Utils.setStatusTextColor(true,this);


        LinearLayoutManager layoutManager = new LinearLayoutManager(this);
        layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
        activityFocusVideoXRecyclerView.setLayoutManager(layoutManager);
        activityFocusVideoXRecyclerView.setRefreshProgressStyle(ProgressStyle.BallSpinFadeLoader);
        activityFocusVideoXRecyclerView.setLoadingMoreProgressStyle(ProgressStyle.BallRotate);

        activityFocusVideoXRecyclerView.setPullRefreshEnabled(false);
        PayAttentionToAdapter payAttentionToAdapter =   new PayAttentionToAdapter();
        activityFocusVideoXRecyclerView.setAdapter(payAttentionToAdapter);
        payAttentionToAdapter.setOnItemClickListener(new OnRecyclerViewItemClickListener() {
            @Override
            public void onItemClick(View view) {
                Intent intent = new Intent(FocusVideoActivity.this,PersonalArticlesActivity.class);
                startActivity(intent);
            }

            @Override
            public void onItemFirstButtonClick(View v, int position) {

            }
        });
    }

    @OnClick({R.id.activity_focus_video_iv_return, R.id.activity_focus_video_tv_Pay_attention})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.activity_focus_video_iv_return:
                finish();
                break;
            case R.id.activity_focus_video_tv_Pay_attention:
                break;
        }
    }
}
